package ejb.dto;

import java.util.List;


public class AirportDTO {

	private int id;
	private String address;
	private LocationDTO location;
	private String name;
	private List<FlightDTO> flights1;
	private List<FlightDTO> flights2;
	private int locationId;

	//GETTER AND SETTER
	
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public LocationDTO getLocation() {
		return this.location;
	}

	public void setLocation(LocationDTO location) {
		this.location = location;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<FlightDTO> getFlights1() {
		return this.flights1;
	}

	public void setFlights1(List<FlightDTO> flights1) {
		this.flights1 = flights1;
	}

	public List<FlightDTO> getFlights2() {
		return this.flights2;
	}

	public void setFlights2(List<FlightDTO> flights2) {
		this.flights2 = flights2;
	}

	public int getLocationId() {
		return locationId;
	}

	public void setLocationId(int locationId) {
		this.locationId = locationId;
	}
	
	//METHODS
	
	/**
	 * Add FlightDTO to list
	 * @param flights1
	 * @return list of FlightDTO
	 */
	public FlightDTO addFlights1(FlightDTO flights1) {
		getFlights1().add(flights1);
		flights1.setAirport1(this);

		return flights1;
	}

	/**
	 * Remove FlightDTo from list
	 * @param flights1
	 * @return list of FlightDTO
	 */
	public FlightDTO removeFlights1(FlightDTO flights1) {
		getFlights1().remove(flights1);
		flights1.setAirport1(null);

		return flights1;
	}
	
	/**
	 * Add FlightDTO to list
	 * @param flights2
	 * @return list of FlightDTO
	 */
	public FlightDTO addFlights2(FlightDTO flights2) {
		getFlights2().add(flights2);
		flights2.setAirport2(this);

		return flights2;
	}
	/**
	 * Remove FlightDTo from list
	 * @param flights2
	 * @return list of FlightDTO
	 */
	public FlightDTO removeFlights2(FlightDTO flights2) {
		getFlights2().remove(flights2);
		flights2.setAirport2(null);

		return flights2;
	}


}